﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.Reflection;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Geodatabase;
using PlanningGIS.Product;


namespace PlanningGIS.Product
{
    #region 元数据基类    
    [Serializable]
    [XmlInclude(typeof(PlanningGISMetadata))]
    [XmlInclude(typeof(PlanningGISDatabaseMetadata))]
    [Program("元数据基类", "元数据相关类（支持序列化），包括数据库级、测区级、图幅级、要素级","元数据")]
    [Developer("徐红波", "2012-11-1","第一技术服务部")]
    public abstract class PlanningGISMetadata : CommonClass
    {
        [XmlAttribute("元数据类型")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(PlanningGISMetadataType))]
        //[DefaultValue(true,"DATABASE_LEVEL")]
        [MustHaveValue()]
        [Length(64)]
        public PlanningGISMetadataType metadataType;

        [XmlAttribute("唯一编码")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue(false)]
        [MustHaveValue()]
        [Length(64)]
        public string GUID;

        public string DataStructureTypeToString()
        {
            switch (metadataType)
            {
                case PlanningGISMetadataType.DATABASE_LEVEL: return "数据库级元数据";
                case PlanningGISMetadataType.REGION_LEVEL_DLG: return "DLG测区级元数据";
                case PlanningGISMetadataType.REGION_LEVEL_DEM: return "DEM测区级元数据";
                case PlanningGISMetadataType.REGION_LEVEL_DOM: return "DOM测区级元数据";
                case PlanningGISMetadataType.MAPSHEET_LEVEL: return "图幅级元数据";
                case PlanningGISMetadataType.FEATURE_LEVEL: return "要素级元数据";
            }

            return "";
        }

        public static PlanningGISField createPlanningGISFieldByFieldName(Type pType, string pFieldName)
        {
            PlanningGISField zjgisField = null;
            bool isDef;
            MemberInfo memberInfo;
            FieldInfo fieldInfo;
            PropertyInfo propertyInfo;
            Type typeTemp;

            if (pType.IsSubclassOf(typeof(PlanningGISMetadata))==false)
            {
                return null;
            }

            zjgisField = new PlanningGISField();

            if (CommonClass.isAField(pType, pFieldName) == true)
            {
                fieldInfo = pType.GetField(pFieldName);
                memberInfo = fieldInfo;
                typeTemp = fieldInfo.FieldType;
                zjgisField.name = fieldInfo.Name;
            }
            else if (CommonClass.isAProperty(pType, pFieldName) == true)
            {
                propertyInfo = pType.GetProperty(pFieldName);
                memberInfo = propertyInfo;
                typeTemp = propertyInfo.PropertyType;
                zjgisField.name = propertyInfo.Name;
            }
            else
            {
                return null;
            }

            isDef = System.Attribute.IsDefined(memberInfo, typeof(XmlAttributeAttribute));
            if (isDef)
            {
                XmlAttributeAttribute xmlAttributeAttribute =
                                 (XmlAttributeAttribute)System.Attribute.GetCustomAttribute(
                                                    memberInfo, typeof(XmlAttributeAttribute));
                if (xmlAttributeAttribute != null)
                {
                    zjgisField.aliasName = xmlAttributeAttribute.AttributeName;
                }
            }

            isDef = System.Attribute.IsDefined(memberInfo, typeof(DefaultValueAttribute));
            if (isDef)
            {
                DefaultValueAttribute defaultValueAttribute =
                                 (DefaultValueAttribute)System.Attribute.GetCustomAttribute(
                                                    memberInfo, typeof(DefaultValueAttribute));
                if (defaultValueAttribute != null)
                {
                    zjgisField.defaultValue = defaultValueAttribute.DefaultValue;
                }
            }

            isDef = System.Attribute.IsDefined(memberInfo, typeof(LengthAttribute));
            if (isDef)
            {
                LengthAttribute lengthAttribute =
                                 (LengthAttribute)System.Attribute.GetCustomAttribute(
                                                    memberInfo, typeof(LengthAttribute));
                if (lengthAttribute != null)
                {
                    zjgisField.length = lengthAttribute.Length;
                }
            }

            if (typeTemp == typeof(Int16))
            {
                zjgisField.fieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeSmallInteger;
            }
            else if (typeTemp == typeof(Int32)
                || typeTemp == typeof(Int64)
                || typeTemp == typeof(long))
            {
                zjgisField.fieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeInteger;
            }
            else if (typeTemp == typeof(Double) || typeTemp == typeof(float))
            {
                zjgisField.fieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeDouble;
            }
            else if (typeTemp == typeof(String) || typeTemp == typeof(Char))
            {
                zjgisField.fieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString;
            }
            else if (typeTemp == typeof(DateTime))
            {
                zjgisField.fieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeDate;
            }
            else
            {
                zjgisField.fieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString;
            }
            
            if (typeTemp == typeof(IGeometry) || zjgisField.name == "Shape")
            {
                zjgisField.fieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeGeometry;

                ESRI.ArcGIS.Geodatabase.IGeometryDef geoDef = new GeometryDefClass();
                IGeometryDefEdit geoDefEdit = geoDef as IGeometryDefEdit;
                geoDefEdit.GeometryType_2 = ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon;
                geoDefEdit.HasM_2 = false;
                geoDefEdit.HasZ_2 = false;
                ISpatialReferenceFactory2 spatialRefFactory = (new SpatialReferenceEnvironment()) as ISpatialReferenceFactory2;
                ISpatialReference spatialRef = spatialRefFactory.CreateSpatialReference(4490);
                geoDefEdit.SpatialReference_2 = spatialRef;
                zjgisField.geometryDef = geoDef;
            }

            return zjgisField;
        }

        //public string getXMLAttributeString(string pFieldName)
        //{
        //    FieldInfo fieldInfo = this.GetType().GetField(pFieldName);

        //    if (fieldInfo==null)
        //    {
        //        return "";
        //    }
        //    bool isDef = System.Attribute.IsDefined(fieldInfo, typeof(XmlAttributeAttribute));
            
        //    if (isDef)
        //    {
        //        XmlAttributeAttribute xmlAttributeAttribute =
        //                         (XmlAttributeAttribute)System.Attribute.GetCustomAttribute(
        //                                            fieldInfo, typeof(XmlAttributeAttribute));
        //        if (xmlAttributeAttribute != null)
        //        {
        //            return xmlAttributeAttribute.AttributeName;
        //        }
        //    }

        //    return "";
        //}
    }
    #endregion 元数据基类

    #region 数据库级元数据类
    [Serializable]
    [XmlInclude(typeof(PlanningGISMetadata))]
    [XmlInclude(typeof(PlanningGISDatabaseMetadata))]
    [Program("数据库级元数据", "数据库级元数据", "元数据")]
    [Developer("徐红波", "2012-11-1", "第一技术服务部")]
    public class PlanningGISDatabaseMetadata : PlanningGISMetadata
    {
        [XmlAttribute("数据名称")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(64)]
        public string dataName;                 //数据名称	VARCHAR2(50)
        [XmlAttribute("数据库管理单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName))]
        [DefaultValue("规划信息中心")]
        [MustHaveValue()]
        [Length(64)]
        public string databaseManageCompanyName;//数据库管理单位名称	VARCHAR2(50)
        [XmlAttribute("数据量")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(20)]
        public string dataSize;                //数据量	VARCHAR2(20)
        [XmlAttribute("元数据创建日期")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue(true,1)]
        [MustHaveValue()]
        [Length(64)]
        public DateTime metadataCreateTime;      //元数据创建日期	DATE
        [XmlAttribute("现势性")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length()]
        public string expressionInfoTime;      //现势性	VARCHAR2(50)
        [XmlAttribute("数据质量评价单位")]
        [AccecptNull(true)]
        [IsSelectValue(true, typeof(CompanyName),true)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string dataQualityEvaluateCompanyName;//数据质量评价单位	VARCHAR2(50)
        [XmlAttribute("数据评价时间")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public DateTime dataEvaluateTime;        //数据评价时间	DATE
        [XmlAttribute("数据质量评价")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string dataQualityEvaluation;   //数据质量评价	VARCHAR2(50)
        [XmlAttribute("更新类型")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(64)]
        public string updateType;              //更新类型	VARCHAR2(20)
        [XmlAttribute("更新数据源")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(500)]
        public string updateResources;          //更新数据源	VARCHAR2(500)
        [XmlAttribute("更新单位")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName),true)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(64)]
        public string updateCompany;           //更新单位	VARCHAR2(50)
        [XmlAttribute("更新时间")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length()]
        public DateTime updateTime;            //更新时间	DATE
        [XmlAttribute("更新比例尺分母")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(64)]
        public string updateScaleDenominator;    //更新比例尺分母	VARCHAR2(64)
        //[XmlAttribute("更新范围")]
        //[AccecptNull(false)]
        //[IsSelectValue(false)]
        //[DefaultValue()]
        //[MustHaveValue()]
        //[Length()]
        private IGeometry shape;         //更新范围	SDO GEOMETRY
       
        [XmlAttribute("更新范围")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length()]
        public string Shape
        {
            get
            {
                string pointColString = "";
                if (shape == null)
                {
                    return pointColString;
                }
                switch (shape.GeometryType)
                {
                    case esriGeometryType.esriGeometryPolygon:
                        pointColString = "POLYGON:";
                        IPointCollection pointCol = shape as IPointCollection;
                        for (int i = 0; i < pointCol.PointCount;i++ )
                        {
                            pointColString = pointColString +pointCol.Point[i].X.ToString()+","+ pointCol.Point[i].Y.ToString()+";";
                        }
                        break;
                }
                return pointColString;
            }
            set
            {
                string geoType = "";
                string[] coordsPt;
                if (value == "")
                    shape = null;
                else
                {
                    int index = value.IndexOf(":");
                    if (index != -1)
                    {
                        geoType = value.Substring(0, index);
                        coordsPt = value.Substring(index + 1).Split(';');
                        IPointCollection4 pointCol = new PolygonClass();
                        for (int i = 0; i < coordsPt.Length; i++)
                        {
                            int index2 = coordsPt[i].IndexOf(",");
                            if (index2 != -1)
                            {
                                IPoint point = new PointClass();
                                point.PutCoords(Convert.ToDouble(coordsPt[i].Substring(0, index2)), Convert.ToDouble(coordsPt[i].Substring(index2 + 1)));
                                pointCol.AddPoint(point);
                            }
                        }
                        switch (geoType)
                        {
                            case "POLYGON":
                                //坐标串最后一点要与第一点闭合
                                int index3 = coordsPt[0].IndexOf(",");
                                if (index3 != -1)
                                {
                                    IPoint point2 = new ESRI.ArcGIS.Geometry.PointClass();
                                    point2.PutCoords(Convert.ToDouble(coordsPt[0].Substring(0, index3)), Convert.ToDouble(coordsPt[0].Substring(index3 + 1)));
                                    pointCol.AddPoint(point2);
                                }

                                IGeometryCollection geometryCollection = pointCol as IGeometryCollection;
                                ISegmentCollection pRing = new RingClass();
                                pRing.AddSegmentCollection(pointCol as ISegmentCollection);
                                IGeometryCollection pPolygon = new PolygonClass();
                                pPolygon.AddGeometry(pRing as IGeometry);
                                shape = pPolygon as IGeometry;
                                break;
                            case "POLYLINE":

                                break;
                        }

                    }

                }
            }
        }

        [XmlAttribute("更新摘要")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(2000)]
        public string updateSummary;           //更新摘要	VARCHAR2(500)
        [XmlAttribute("涉及测区")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(500)]
        public string relatedRegion;           //涉及测区	VARCHAR2(500)

        [XmlAttribute("更新参考资料")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(500)]
        public string updateRefences;           //更新参考资料	VARCHAR2(500)

        [XmlAttribute("数据格式")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("gdb")]
        [MustHaveValue()]
        [Length(20)]
        public string dataFormat;              //数据格式	VARCHAR2(20)
        [XmlAttribute("密级")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("秘密")]
        [MustHaveValue()]
        [Length(4)]
        public string secrecyLevel;            //密级	VARCHAR2(4)
        [XmlAttribute("平面坐标系")]
        [IsSelectValue(true, typeof(CoordinateSystem))]
        [AccecptNull(false)]
        [DefaultValue("2000国家大地坐标系")]
        [MustHaveValue()]
        [Length(64)]
        public string locationSystemName;      //坐标系统名称	VARCHAR2(50)
        [XmlAttribute("高程基准")]
        [IsSelectValue(true, typeof(AltitudeStandard))]
        [AccecptNull(false)]
        [DefaultValue("1985国家高程基准")]
        [MustHaveValue()]
        [Length(64)]
        public string elevationBenchmark;      //高程基准	VARCHAR2(50)
        [XmlAttribute("坐标单位")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("度")]
        [MustHaveValue()]
        [Length(10)]
        public string locationUnit;            //坐标单位	VARCHAR2(10)
        [XmlAttribute("产品所有权单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue("浙江省测绘与地理信息局")]
        [MustHaveValue()]
        [Length(64)]
        public string productOwnerCompanyName; //产品所有权单位名称	VARCHAR2(50)
        [XmlAttribute("分发介质")]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string distributionMedium;      //分发介质	VARCHAR2(20)
        [XmlAttribute("分发格式")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string distributionFormat;       //分发格式	VARCHAR2(20)
        [XmlAttribute("分发单位联系电话")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string distributionCompanyPhone; //分发单位联系电话	VARCHAR2(20)
        [XmlAttribute("分发单位传真电话")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [Length(64)]
        public string distributionCompanyFax;   //分发单位传真电话	VARCHAR2(20)
        [XmlAttribute("分发单位通讯地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(255)]
        public string distributionCompanyAddress;   //分发单位通讯地址	VARCHAR2(100)
        [XmlAttribute("分发单位邮政编码")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string distributionCompanyPostcode;  //分发单位邮政编码	VARCHAR2
        [XmlAttribute("分发单位名称")]
        [AccecptNull(true)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string distributionCompanyName;      //分发单位名称	VARCHAR2
        [XmlAttribute("分发单位电子邮箱地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string distributionCompanyEmail;     //分发单位电子邮箱地址	VARCHAR2
        [XmlAttribute("分发单位网络地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(64)]
        public string distributionCompanyWebsite;   //分发单位网络地址	VARCHAR2
        [XmlAttribute("分发日期")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length()]
        public DateTime distributionDate;           //分发日期	DATE
       
        public PlanningGISDatabaseMetadata()
        {
            metadataType = PlanningGISMetadataType.DATABASE_LEVEL;
            GUID = CommonClass.GetGUID();
        }
    }
    #endregion 数据库级元数据类

    #region 测区级元数据类
    [Serializable]
    [Program("测区级元数据类", "测区级元数据类", "元数据")]
    [Developer("徐红波", "2012-11-1", "第一技术服务部")]
    public class PlanningGISRegionMetadata : PlanningGISMetadata
    {
        #region 属性项
        [XmlAttribute("产品名称")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(3)]
        public string productName;                 //产品名称	VARCHAR2(3)

        private IGeometry shape;         //更新范围	SDO GEOMETRY

        [XmlAttribute("范围")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length()]
        public string Shape
        {
            get
            {
                string pointColString = "";
                if (shape == null)
                {
                    return pointColString;
                }
                switch (shape.GeometryType)
                {
                    case esriGeometryType.esriGeometryPolygon:
                        pointColString = "POLYGON:";
                        IPointCollection pointCol = shape as IPointCollection;
                        for (int i = 0; i < pointCol.PointCount; i++)
                        {
                            pointColString = pointColString + pointCol.Point[i].X.ToString() + "," + pointCol.Point[i].Y.ToString() + ";";
                        }
                        break;
                }
                return pointColString;
            }
            set
            {
                string geoType = "";
                string[] coordsPt;
                if (value == "")
                    shape = null;
                else
                {
                    int index = value.IndexOf(":");
                    if (index != -1)
                    {
                        geoType = value.Substring(0, index);
                        coordsPt = value.Substring(index + 1).Split(';');
                        IPointCollection4 pointCol = new PolygonClass();
                        for (int i = 0; i < coordsPt.Length; i++)
                        {
                            int index2 = coordsPt[i].IndexOf(",");
                            if (index2 != -1)
                            {
                                IPoint point = new PointClass();
                                point.PutCoords(Convert.ToDouble(coordsPt[i].Substring(0, index2)), Convert.ToDouble(coordsPt[i].Substring(index2 + 1)));
                                pointCol.AddPoint(point);
                            }
                        }
                        switch (geoType)
                        {
                            case "POLYGON":
                                //坐标串最后一点要与第一点闭合
                                int index3 = coordsPt[0].IndexOf(",");
                                if (index3 != -1)
                                {
                                    IPoint point2 = new ESRI.ArcGIS.Geometry.PointClass();
                                    point2.PutCoords(Convert.ToDouble(coordsPt[0].Substring(0, index3)), Convert.ToDouble(coordsPt[0].Substring(index3 + 1)));
                                    pointCol.AddPoint(point2);
                                }

                                IGeometryCollection geometryCollection = pointCol as IGeometryCollection;
                                ISegmentCollection pRing = new RingClass();
                                pRing.AddSegmentCollection(pointCol as ISegmentCollection);
                                IGeometryCollection pPolygon = new PolygonClass();
                                pPolygon.AddGeometry(pRing as IGeometry);
                                shape = pPolygon as IGeometry;
                                break;
                            case "POLYLINE":

                                break;
                        }

                    }

                }
            }
        }

        [XmlAttribute("测区名称")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string regionName;                 //测区名称	VARCHAR2(50)

        [XmlAttribute("测区代号")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string regionNumber;               //测区代号  	VARCHAR2(50)

        [XmlAttribute("比例尺分母")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(ScaleDenominator), true)]
        [DefaultValue()]
        [MustHaveValue()]
        public long scaleDenominator;           //比例尺分母	LONG

        [XmlAttribute("产品生产单位名称")]
        [AccecptNull(false )]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(50)]
        public string productCompanyName;       //产品生产单位名称	VARCHAR2(50)

        [XmlAttribute("产品生产日期")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue(true, 1)]
        [MustHaveValue()]
        public DateTime productCreateTime;      //产品生产日期	DATE

        [XmlAttribute("密级")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("秘密")]
        [MustHaveValue()]
        [Length(4)]
        public string secrecyLevel;            //密级	VARCHAR2(4)

        [XmlAttribute("图幅数")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long mapsheetSum;                //图幅数	LONG

        [XmlAttribute("遗留问题")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string reserveQuestion;                    //遗留问题 	VARCHAR2(255)

        [XmlAttribute("平面坐标系")]
        [IsSelectValue(true, typeof(CoordinateSystem))]
        [AccecptNull(false)]
        [DefaultValue("2000国家大地坐标系")]
        [MustHaveValue()]
        [Length(50)]
        public string locationSystemName;      //坐标系统名称	VARCHAR2(50)

        [XmlAttribute("坐标单位")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("米")]
        [MustHaveValue()]
        [Length(10)]
        public string locationUnit;            //坐标单位	VARCHAR2(10)

        [XmlAttribute("投影方式")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("高斯-克吕格投影")]
        [MustHaveValue()]
        [Length(10)]
        public string projectionMethod;            //投影方式	VARCHAR2(10)

        [XmlAttribute("分带方式")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("3度分带")]
        [MustHaveValue()]
        [Length(10)]
        public string zonageMethod;                   //分带方式	VARCHAR2(10)

        [XmlAttribute("投影带号")]
        [AccecptNull(false)]
        [IsSelectValue(true,typeof(ProjectionNumber),false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long projectionReelNumber;             //投影带号	LONG

        [XmlAttribute("数据质量评价")]
        [AccecptNull(false )]
        [IsSelectValue(true,typeof(DataQualityEvaluation),false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string dataQualityEvaluation;          //数据质量评价	VARCHAR2(50)

        [XmlAttribute("数据质量检验评价单位")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName),true)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string dataQualityCheckEvaluationCompany;           //数据质量检验评价单位	VARCHAR2(50)

        [XmlAttribute("产品所有权单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName),true)]
        [DefaultValue("浙江省测绘与地理信息局")]
        [MustHaveValue()]
        [Length(50)]
        public string productOwnerCompanyName;                     //产品所有权单位名称	    VARCHAR2(50)
        
        [XmlAttribute("备注")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        [Length(255)]
        public string remark;           //备注	VARCHAR2(255)
        #endregion
        public PlanningGISRegionMetadata()
        {
            //metadataType = PlanningGISMetadataType.REGION_LEVEL;
            //GUID = CommonClass.GetGUID();
        }
    }
    #endregion 测区级元数据类

    #region DLG、DEM、DOM 测区级元数据类
    [Serializable]
    [Program("DLG测区级元数据类", "DLG测区级元数据类", "元数据")]
    [Developer("ZJX", "2013-1-6", "第一技术服务部")]
    public class PlanningGISDLGRegionMetadata : PlanningGISRegionMetadata
    {
        [XmlAttribute("数据格式")]
        [AccecptNull(false)]
        [IsSelectValue(true,typeof(DLGDataFormat),false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(20)]
        public string dataFormat;                         //数据格式	VARCHAR2(20)

        [XmlAttribute("行政隶属")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string districtSubject;                    //行政隶属	VARCHAR2(50)

        [XmlAttribute("更新生产方式")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(DLGProduceMethod), true)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string updateProduceMethod;                //更新生产方式	VARCHAR2(50)

        [XmlAttribute("测区摘要")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string regionSummary;                      //测区摘要	VARCHAR2(255)

        [XmlAttribute("产品名称")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string productName;  
        [XmlAttribute("测区名称")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string regionName; 
        [XmlAttribute("比例尺分母")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long scaleDenominator;   
        [XmlAttribute("测区代号")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string regionNum; 
        [XmlAttribute("产品生产单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string productCompanyName;     
        [XmlAttribute("产品生产日期")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public DateTime productTime;      
        [XmlAttribute("图幅数")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long mapSheetsNum;       
        [XmlAttribute("遗留问题")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string lostQuestion;
        [XmlAttribute("产品所有权单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(true , typeof(CompanyName) , true)]
        [DefaultValue("浙江省测绘与地理信息局")]
        [MustHaveValue()]
        public string productOwnerCompanyName;
        [XmlAttribute("投影方式")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string touyingType;    
        [XmlAttribute("投影带号")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long touyingNum;
        [XmlAttribute("备注")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(255)]
        public string remark;
        [XmlAttribute("数据质量检验评价单位")]
        [AccecptNull(true)]
        [IsSelectValue(true , typeof(CompanyName) , true)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string dataQualityEvaluateCompanyName;//数据质量评价单位	VARCHAR2(50)
        [XmlAttribute("数据评价时间")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public DateTime dataEvaluateTime;        //数据评价时间	DATE
        [XmlAttribute("数据质量评价")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string dataQualityEvaluation;   //数据质量评价
        [XmlAttribute("平面坐标系")]
        [IsSelectValue(true , typeof(CoordinateSystem))]
        [AccecptNull(false)]
        [DefaultValue("2000国家大地坐标系")]
        [MustHaveValue()]
        public string locationSystemName;      //坐标系统名称	VARCHAR2(50)
        [XmlAttribute("高程基准")]
        [IsSelectValue(true , typeof(AltitudeStandard))]
        [AccecptNull(false)]
        [DefaultValue("1985国家高程基准")]
        [MustHaveValue()]
        public string elevationBenchmark;      //高程基准	VARCHAR2(50)
        [XmlAttribute("坐标单位")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("度")]
        [MustHaveValue()]
        public string locationUnit;            //坐标单位	VARCHAR2(10)

        public PlanningGISDLGRegionMetadata()
        {
            metadataType = PlanningGISMetadataType.REGION_LEVEL_DLG;
            GUID = CommonClass.GetGUID();
        }
    }

    [Serializable]
    [Program("DEM测区级元数据类", "DEM测区级元数据类", "元数据")]
    [Developer("ZJX", "2013-1-6", "第一技术服务部")]
    public class PlanningGISDEMRegionMetadata : PlanningGISRegionMetadata
    {
        [XmlAttribute("数据格式")]
        [AccecptNull(false)]
        [IsSelectValue(false )]
        [DefaultValue("img")]
        [MustHaveValue()]
        [Length(20)]
        public string dataFormat;                   //数据格式	VARCHAR2(20)

        [XmlAttribute("DEM数据西北格网点X坐标")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long demNorthwestX;                  //DEM数据西北格网点X坐标	LONG

        [XmlAttribute("DEM数据西北格网点Y坐标")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long demNorthwestY;                  //DEM数据西北格网点Y坐标	LONG

        [XmlAttribute("DEM数据东南格网点X坐标")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long demSoutheastX;                  //DEM数据东南格网点X坐标	LONG

        [XmlAttribute("DEM数据东南格网点Y坐标")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long demSoutheastY;                  //DEM数据东南格网点Y坐标	LONG

        [XmlAttribute("格网间距")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("5")]
        [MustHaveValue()]
        public long gridInterval;                   //格网间距	LONG

        [XmlAttribute("更新方式")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(DEMUpdateMethod), false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string updateMethod;                 //更新方式	VARCHAR2(50)

        [XmlAttribute("高程基准")]
        [IsSelectValue(true, typeof(AltitudeStandard))]
        [AccecptNull(false)]
        [DefaultValue("1985国家高程基准")]
        [MustHaveValue()]
        [Length(50)]
        public string elevationBenchmark;           //高程基准	VARCHAR2(50)

        public PlanningGISDEMRegionMetadata()
        {
            metadataType = PlanningGISMetadataType.REGION_LEVEL_DEM;
            GUID = CommonClass.GetGUID();
        }
    }

    [Serializable]
    [Program("DOM测区级元数据类", "DOM测区级元数据类", "元数据")]
    [Developer("ZJX", "2013-1-6", "第一技术服务部")]
    public class PlanningGISDOMRegionMetadata : PlanningGISRegionMetadata
    {
        [XmlAttribute("数据格式")]
        [AccecptNull(false)]
        [IsSelectValue(true,typeof(DOMDataFormat),true)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(20)]
        public string dataFormat;              //数据格式	VARCHAR2(20)

        [XmlAttribute("DOM数据范围外接矩形西南角点X坐标")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long domEnvelopSouthwestX;       //DOM数据范围外接矩形西南角点X坐标	LONG

        [XmlAttribute("DOM数据范围外接矩形西南角点Y坐标")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long domEnvelopSouthwestY;       //DOM数据范围外接矩形西南角点Y坐标	LONG

        [XmlAttribute("DOM数据范围外接矩形东北角点X坐标")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long domEnvelopNortheastX;       //DOM数据范围外接矩形东北角点X坐标	LONG

        [XmlAttribute("DOM数据范围外接矩形东北角点Y坐标")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long domEnvelopNortheastY;       //DOM数据范围外接矩形东北角点Y坐标	LONG

        [XmlAttribute("更新方式")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(DOMUpdateMethod), false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string updateMethod;              //更新方式	VARCHAR2(50)

        [XmlAttribute("DOM地面分辨率")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(DOMResolution), true)]
        [DefaultValue()]
        [MustHaveValue()]
        public long domResolution;              //DOM地面分辨率	LONG

        [XmlAttribute("影像资料源")]
        [IsSelectValue(true, typeof(ImageDataSource),true )]
        [AccecptNull(false)]
        [DefaultValue()]
        [MustHaveValue()]
        [Length(50)]
        public string imageDataSource;          //影像资料源	VARCHAR2(50)
        public PlanningGISDOMRegionMetadata()
        {
            metadataType = PlanningGISMetadataType.REGION_LEVEL_DOM;
            GUID = CommonClass.GetGUID();
        }
    }
    #endregion

    #region 图幅级元数据类
    [Serializable]
    [Program("图幅级元数据类", "图幅级元数据类", "元数据")]
    [Developer("徐红波", "2012-11-1", "第一技术服务部")]
    public class PlanningGISMapsheetMetadata : PlanningGISMetadata
    {
        [XmlAttribute("数据名称")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public string dataName;                 //数据名称	VARCHAR2(50)
        [XmlAttribute("数据库管理单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName))]
        [DefaultValue("规划信息中心")]
        [MustHaveValue()]
        public string databaseManageCompanyName;//数据库管理单位名称	VARCHAR2(50)
        [XmlAttribute("数据量")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public string dataSize;                //数据量	VARCHAR2(20)
        [XmlAttribute("元数据创建日期")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue(true, 1)]
        [MustHaveValue()]
        public DateTime metadataCreateTime;      //元数据创建日期	DATE
        [XmlAttribute("现势性")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public string expressionInfoTime;      //现势性	VARCHAR2(50)
        [XmlAttribute("数据质量评价单位")]
        [AccecptNull(true)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string dataQualityEvaluateCompanyName;//数据质量评价单位	VARCHAR2(50)
        [XmlAttribute("数据评价时间")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public DateTime dataEvaluateTime;        //数据评价时间	DATE
        [XmlAttribute("数据质量评价")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string dataQualityEvaluation;   //数据质量评价	VARCHAR2(50)
        [XmlAttribute("更新类型")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public string updateType;              //更新类型	VARCHAR2(20)
        [XmlAttribute("更新单位")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue()]
        [MustHaveValue()]
        public string updateCompany;           //更新单位	VARCHAR2(50)
        [XmlAttribute("更新时间")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public DateTime updateTime;            //更新时间	DATE
        [XmlAttribute("更新比例尺分母")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long updateScaleDenominator;    //更新比例尺分母	LONG
        [XmlAttribute("更新范围")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public IGeometry updateDomain;         //更新范围	SDO GEOMETRY
        [XmlAttribute("更新摘要")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string updateSummary;           //更新摘要	VARCHAR2(500)
        [XmlAttribute("涉及测区")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string relatedRegion;           //涉及测区	VARCHAR2(500)
        [XmlAttribute("更新参考资料")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string updateRefences;          //更新参考资料	VARCHAR2(500)
        [XmlAttribute("数据格式")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("gdb")]
        [MustHaveValue()]
        public string dataFormat;              //数据格式	VARCHAR2(20)
        [XmlAttribute("密级")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("秘密")]
        [MustHaveValue()]
        public string secrecyLevel;            //密级	VARCHAR2(4)
        [XmlAttribute("平面坐标系")]
        [IsSelectValue(true, typeof(CoordinateSystem))]
        [AccecptNull(false)]
        [DefaultValue("2000国家大地坐标系")]
        [MustHaveValue()]
        public string locationSystemName;      //坐标系统名称	VARCHAR2(50)
        [XmlAttribute("高程基准")]
        [IsSelectValue(true, typeof(AltitudeStandard))]
        [AccecptNull(false)]
        [DefaultValue("1985国家高程基准")]
        [MustHaveValue()]
        public string elevationBenchmark;      //高程基准	VARCHAR2(50)
        [XmlAttribute("坐标单位")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("度")]
        [MustHaveValue()]
        public string locationUnit;            //坐标单位	VARCHAR2(10)
        [XmlAttribute("产品所有权单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue("浙江省测绘与地理信息局")]
        [MustHaveValue()]
        public string productOwnerCompanyName; //产品所有权单位名称	VARCHAR2(50)
        [XmlAttribute("分发介质")]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionMedium;      //分发介质	VARCHAR2(20)
        [XmlAttribute("分发格式")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionFormat;       //分发格式	VARCHAR2(20)
        [XmlAttribute("分发单位联系电话")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyPhone; //分发单位联系电话	VARCHAR2(20)
        [XmlAttribute("分发单位传真电话")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        public string distributionCompanyFax;   //分发单位传真电话	VARCHAR2(20)
        [XmlAttribute("分发单位通讯地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyAddress;   //分发单位通讯地址	VARCHAR2(100)
        [XmlAttribute("分发单位邮政编码")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyPostcode;  //分发单位邮政编码	VARCHAR2(6)
        [XmlAttribute("分发单位名称")]
        [AccecptNull(true)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyName;      //分发单位名称	VARCHAR2(50)
        [XmlAttribute("分发单位电子邮箱地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyEmail;     //分发单位电子邮箱地址	VARCHAR2(50)
        [XmlAttribute("分发单位网络地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyWebsite;   //分发单位网络地址	VARCHAR2(50)
        [XmlAttribute("分发日期")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public DateTime distributionDate;           //分发日期	DATE

        public PlanningGISMapsheetMetadata()
        {
            metadataType = PlanningGISMetadataType.MAPSHEET_LEVEL;
            GUID = CommonClass.GetGUID();
        }
    }
    #endregion 图幅级元数据类

    #region 要素级元数据类
    [Serializable]
    [Program("要素级元数据类", "要素级元数据类", "元数据")]
    [Developer("徐红波", "2012-11-1", "第一技术服务部")]
    public class PlanningGISFeatureMetadata : PlanningGISMetadata
    {
        // TODO：属性需要替换，以下属性仅测试用
        [XmlAttribute("数据名称")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public string dataName;                 //数据名称	VARCHAR2(50)
        [XmlAttribute("数据库管理单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName))]
        [DefaultValue("规划信息中心")]
        [MustHaveValue()]
        public string databaseManageCompanyName;//数据库管理单位名称	VARCHAR2(50)
        [XmlAttribute("数据量")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public string dataSize;                //数据量	VARCHAR2(20)
        [XmlAttribute("元数据创建日期")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue(true, 1)]
        [MustHaveValue()]
        public DateTime metadataCreateTime;      //元数据创建日期	DATE
        [XmlAttribute("现势性")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public string expressionInfoTime;      //现势性	VARCHAR2(50)
        [XmlAttribute("数据质量评价单位")]
        [AccecptNull(true)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string dataQualityEvaluateCompanyName;//数据质量评价单位	VARCHAR2(50)
        [XmlAttribute("数据评价时间")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public DateTime dataEvaluateTime;        //数据评价时间	DATE
        [XmlAttribute("数据质量评价")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string dataQualityEvaluation;   //数据质量评价	VARCHAR2(50)
        [XmlAttribute("更新类型")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public string updateType;              //更新类型	VARCHAR2(20)
        [XmlAttribute("更新单位")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue()]
        [MustHaveValue()]
        public string updateCompany;           //更新单位	VARCHAR2(50)
        [XmlAttribute("更新时间")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public DateTime updateTime;            //更新时间	DATE
        [XmlAttribute("更新比例尺分母")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public long updateScaleDenominator;    //更新比例尺分母	LONG
        [XmlAttribute("更新范围")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue()]
        public IGeometry updateDomain;         //更新范围	SDO GEOMETRY
        [XmlAttribute("更新摘要")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string updateSummary;           //更新摘要	VARCHAR2(500)
        [XmlAttribute("涉及测区")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string relatedRegion;           //涉及测区	VARCHAR2(500)
        [XmlAttribute("更新参考资料")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string updateRefences;          //更新参考资料	VARCHAR2(500)
        [XmlAttribute("数据格式")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("gdb")]
        [MustHaveValue()]
        public string dataFormat;              //数据格式	VARCHAR2(20)
        [XmlAttribute("密级")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("秘密")]
        [MustHaveValue()]
        public string secrecyLevel;            //密级	VARCHAR2(4)
        [XmlAttribute("平面坐标系")]
        [IsSelectValue(true, typeof(CoordinateSystem))]
        [AccecptNull(false)]
        [DefaultValue("2000国家大地坐标系")]
        [MustHaveValue()]
        public string locationSystemName;      //坐标系统名称	VARCHAR2(50)
        [XmlAttribute("高程基准")]
        [IsSelectValue(true, typeof(AltitudeStandard))]
        [AccecptNull(false)]
        [DefaultValue("1985国家高程基准")]
        [MustHaveValue()]
        public string elevationBenchmark;      //高程基准	VARCHAR2(50)
        [XmlAttribute("坐标单位")]
        [AccecptNull(false)]
        [IsSelectValue(false)]
        [DefaultValue("度")]
        [MustHaveValue()]
        public string locationUnit;            //坐标单位	VARCHAR2(10)
        [XmlAttribute("产品所有权单位名称")]
        [AccecptNull(false)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue("浙江省测绘与地理信息局")]
        [MustHaveValue()]
        public string productOwnerCompanyName; //产品所有权单位名称	VARCHAR2(50)
        [XmlAttribute("分发介质")]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionMedium;      //分发介质	VARCHAR2(20)
        [XmlAttribute("分发格式")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionFormat;       //分发格式	VARCHAR2(20)
        [XmlAttribute("分发单位联系电话")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyPhone; //分发单位联系电话	VARCHAR2(20)
        [XmlAttribute("分发单位传真电话")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        public string distributionCompanyFax;   //分发单位传真电话	VARCHAR2(20)
        [XmlAttribute("分发单位通讯地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyAddress;   //分发单位通讯地址	VARCHAR2(100)
        [XmlAttribute("分发单位邮政编码")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyPostcode;  //分发单位邮政编码	VARCHAR2(6)
        [XmlAttribute("分发单位名称")]
        [AccecptNull(true)]
        [IsSelectValue(true, typeof(CompanyName), true)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyName;      //分发单位名称	VARCHAR2(50)
        [XmlAttribute("分发单位电子邮箱地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyEmail;     //分发单位电子邮箱地址	VARCHAR2(50)
        [XmlAttribute("分发单位网络地址")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public string distributionCompanyWebsite;   //分发单位网络地址	VARCHAR2(50)
        [XmlAttribute("分发日期")]
        [AccecptNull(true)]
        [IsSelectValue(false)]
        [DefaultValue()]
        [MustHaveValue(false)]
        public DateTime distributionDate;           //分发日期	DATE

        public PlanningGISFeatureMetadata()
        {
            metadataType = PlanningGISMetadataType.FEATURE_LEVEL;
            GUID = CommonClass.GetGUID();
        }
    }
    #endregion 要素级元数据类

    #region 元数据类型 枚举
    /// <summary>
    /// 元数据类型 枚举
    /// </summary>
    public enum PlanningGISMetadataType
    {
        DATABASE_LEVEL,                 // 数据库级元数据
        REGION_LEVEL_DLG,               // DLG测区级元数据
        REGION_LEVEL_DEM,               // DEM测区级元数据
        REGION_LEVEL_DOM,               // DOM测区级元数据
        MAPSHEET_LEVEL,                 // 图幅级元数据
        FEATURE_LEVEL,                  // 要素级元数据
    }

    /// <summary>
    /// 单位名称
    /// </summary>
    public enum CompanyName
    {
        浙江省测绘局,
        浙江省测绘与地理信息局,
        规划信息中心,
        浙江省第一测绘院,
        浙江省第二测绘院,
        浙江省测绘资料档案馆,
        浙江省测绘科学技术研究院,
        浙江省测绘产品质量监督检验站
    }

    /// <summary>
    /// 平面坐标系
    /// </summary>
    public enum CoordinateSystem
    {
        _2000国家大地坐标系,
        _1980西安坐标系,
        _1954北京坐标系
    }

    /// <summary>
    /// 高程基准
    /// </summary>
    public enum AltitudeStandard
    {
        _1985国家高程基准,
        _1956黄海高程基准
    }

    /// <summary>
    /// 比例尺分母
    /// </summary>
    public enum ScaleDenominator
    {
        _10000,
        _5000
    }

    /// <summary>
    /// 更新生产方式
    /// </summary>
    public enum DLGProduceMethod
    {
        全要素更新,
        要素级更新,
        航空摄影测量法,
        航天遥感测量法,
        地图编绘法,
        外业测绘法
    }

    /// <summary>
    /// DEM测区级元数据更新方式
    /// </summary>
    public enum DEMUpdateMethod
    {
        三维矢量数据结构TIN内插DEM算法,
        全数字摄影测量工作站获取DEM方法,
        Lidar点云滤波获取DEM方法
    }
    /// <summary>
    /// DOM测区级元数据更新方式
    /// </summary>
    public enum DOMUpdateMethod
    {
        航空摄影测量法,
        航天遥感测量法
    }
     /// <summary>
    /// 数据质量评价
    /// </summary>
    public enum DataQualityEvaluation
    {
        批合格,
        批不合格
    }
    /// <summary>
    /// DLG测区级元数据数据格式
    /// </summary>
    public enum DLGDataFormat
    {
        GDB,
        MDB
    }
    /// <summary>
    /// DOM测区级元数据数据格式
    /// </summary>
    public enum DOMDataFormat
    {
        geotiff,
        tfw
    }

    /// <summary>
    /// DOM测区级元数据地面分辨率
    /// </summary>
    public enum DOMResolution
    {
        _10,//单位为分米
       _5
    }

    /// <summary>
    /// DOM影像资料源
    /// </summary>
    public enum ImageDataSource
    {
        航片,
        卫片
    }

    /// <summary>
    /// 投影带号
    /// </summary>
    public enum ProjectionNumber
    {
        _39,
        _40,
        _41
    }
    #endregion 元数据类型 枚举
}
